3.1.70 \(\int x^2 (a+b \sin (c+d x^3))^2 \, dx\) [70]

Optimal. Leaf size=60 \[ \frac {1}{6} \left (2 a^2+b^2\right ) x^3-\frac {2 a b \cos \left (c+d x^3\right )}{3 d}-\frac {b^2 \cos \left (c+d x^3\right ) \sin \left (c+d x^3\right )}{6 d} \]

[Out]

1/6*(2*a^2+b^2)*x^3-2/3*a*b*cos(d*x^3+c)/d-1/6*b^2*cos(d*x^3+c)*sin(d*x^3+c)/d

________________________________________________________________________________________

Rubi [A]
time = 0.04, antiderivative size = 60, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 18, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.111, Rules used = {3460, 2723} \begin {gather*} \frac {1}{6} x^3 \left (2 a^2+b^2\right )-\frac {2 a b \cos \left (c+d x^3\right )}{3 d}-\frac {b^2 \sin \left (c+d x^3\right ) \cos \left (c+d x^3\right )}{6 d} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[x^2*(a + b*Sin[c + d*x^3])^2,x]

[Out]

((2*a^2 + b^2)*x^3)/6 - (2*a*b*Cos[c + d*x^3])/(3*d) - (b^2*Cos[c + d*x^3]*Sin[c + d*x^3])/(6*d)

Rule 2723

Int[((a_) + (b_.)*sin[(c_.) + (d_.)*(x_)])^2, x_Symbol] :> Simp[(2*a^2 + b^2)*(x/2), x] + (-Simp[2*a*b*(Cos[c
+ d*x]/d), x] - Simp[b^2*Cos[c + d*x]*(Sin[c + d*x]/(2*d)), x]) /; FreeQ[{a, b, c, d}, x]

Rule 3460

Int[(x_)^(m_.)*((a_.) + (b_.)*Sin[(c_.) + (d_.)*(x_)^(n_)])^(p_.), x_Symbol] :> Dist[1/n, Subst[Int[x^(Simplif
y[(m + 1)/n] - 1)*(a + b*Sin[c + d*x])^p, x], x, x^n], x] /; FreeQ[{a, b, c, d, m, n, p}, x] && IntegerQ[Simpl
ify[(m + 1)/n]] && (EqQ[p, 1] || EqQ[m, n - 1] || (IntegerQ[p] && GtQ[Simplify[(m + 1)/n], 0]))

Rubi steps

\begin {align*} \int x^2 \left (a+b \sin \left (c+d x^3\right )\right )^2 \, dx &=\frac {1}{3} \text {Subst}\left (\int (a+b \sin (c+d x))^2 \, dx,x,x^3\right )\\ &=\frac {1}{6} \left (2 a^2+b^2\right ) x^3-\frac {2 a b \cos \left (c+d x^3\right )}{3 d}-\frac {b^2 \cos \left (c+d x^3\right ) \sin \left (c+d x^3\right )}{6 d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.12, size = 52, normalized size = 0.87 \begin {gather*} -\frac {-2 \left (2 a^2+b^2\right ) \left (c+d x^3\right )+8 a b \cos \left (c+d x^3\right )+b^2 \sin \left (2 \left (c+d x^3\right )\right )}{12 d} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[x^2*(a + b*Sin[c + d*x^3])^2,x]

[Out]

-1/12*(-2*(2*a^2 + b^2)*(c + d*x^3) + 8*a*b*Cos[c + d*x^3] + b^2*Sin[2*(c + d*x^3)])/d

________________________________________________________________________________________

Maple [A]
time = 0.06, size = 62, normalized size = 1.03

method result size
risch \(\frac {x^{3} a^{2}}{3}+\frac {x^{3} b^{2}}{6}-\frac {2 a b \cos \left (d \,x^{3}+c \right )}{3 d}-\frac {b^{2} \sin \left (2 d \,x^{3}+2 c \right )}{12 d}\) \(52\)
derivativedivides \(\frac {b^{2} \left (-\frac {\cos \left (d \,x^{3}+c \right ) \sin \left (d \,x^{3}+c \right )}{2}+\frac {d \,x^{3}}{2}+\frac {c}{2}\right )-2 a b \cos \left (d \,x^{3}+c \right )+a^{2} \left (d \,x^{3}+c \right )}{3 d}\) \(62\)
default \(\frac {b^{2} \left (-\frac {\cos \left (d \,x^{3}+c \right ) \sin \left (d \,x^{3}+c \right )}{2}+\frac {d \,x^{3}}{2}+\frac {c}{2}\right )-2 a b \cos \left (d \,x^{3}+c \right )+a^{2} \left (d \,x^{3}+c \right )}{3 d}\) \(62\)
norman \(\frac {\left (\frac {a^{2}}{3}+\frac {b^{2}}{6}\right ) x^{3}+\left (\frac {a^{2}}{3}+\frac {b^{2}}{6}\right ) x^{3} \left (\tan ^{4}\left (\frac {d \,x^{3}}{2}+\frac {c}{2}\right )\right )+\left (\frac {2 a^{2}}{3}+\frac {b^{2}}{3}\right ) x^{3} \left (\tan ^{2}\left (\frac {d \,x^{3}}{2}+\frac {c}{2}\right )\right )-\frac {4 a b}{3 d}-\frac {b^{2} \tan \left (\frac {d \,x^{3}}{2}+\frac {c}{2}\right )}{3 d}+\frac {b^{2} \left (\tan ^{3}\left (\frac {d \,x^{3}}{2}+\frac {c}{2}\right )\right )}{3 d}-\frac {4 a b \left (\tan ^{2}\left (\frac {d \,x^{3}}{2}+\frac {c}{2}\right )\right )}{3 d}}{\left (1+\tan ^{2}\left (\frac {d \,x^{3}}{2}+\frac {c}{2}\right )\right )^{2}}\) \(158\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x^2*(a+b*sin(d*x^3+c))^2,x,method=_RETURNVERBOSE)

[Out]

1/3/d*(b^2*(-1/2*cos(d*x^3+c)*sin(d*x^3+c)+1/2*d*x^3+1/2*c)-2*a*b*cos(d*x^3+c)+a^2*(d*x^3+c))

________________________________________________________________________________________

Maxima [A]
time = 0.35, size = 52, normalized size = 0.87 \begin {gather*} \frac {1}{3} \, a^{2} x^{3} + \frac {{\left (2 \, d x^{3} - \sin \left (2 \, d x^{3} + 2 \, c\right )\right )} b^{2}}{12 \, d} - \frac {2 \, a b \cos \left (d x^{3} + c\right )}{3 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^2*(a+b*sin(d*x^3+c))^2,x, algorithm="maxima")

[Out]

1/3*a^2*x^3 + 1/12*(2*d*x^3 - sin(2*d*x^3 + 2*c))*b^2/d - 2/3*a*b*cos(d*x^3 + c)/d

________________________________________________________________________________________

Fricas [A]
time = 0.39, size = 53, normalized size = 0.88 \begin {gather*} \frac {{\left (2 \, a^{2} + b^{2}\right )} d x^{3} - b^{2} \cos \left (d x^{3} + c\right ) \sin \left (d x^{3} + c\right ) - 4 \, a b \cos \left (d x^{3} + c\right )}{6 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^2*(a+b*sin(d*x^3+c))^2,x, algorithm="fricas")

[Out]

1/6*((2*a^2 + b^2)*d*x^3 - b^2*cos(d*x^3 + c)*sin(d*x^3 + c) - 4*a*b*cos(d*x^3 + c))/d

________________________________________________________________________________________

Sympy [A]
time = 0.18, size = 99, normalized size = 1.65 \begin {gather*} \begin {cases} \frac {a^{2} x^{3}}{3} - \frac {2 a b \cos {\left (c + d x^{3} \right )}}{3 d} + \frac {b^{2} x^{3} \sin ^{2}{\left (c + d x^{3} \right )}}{6} + \frac {b^{2} x^{3} \cos ^{2}{\left (c + d x^{3} \right )}}{6} - \frac {b^{2} \sin {\left (c + d x^{3} \right )} \cos {\left (c + d x^{3} \right )}}{6 d} & \text {for}\: d \neq 0 \\\frac {x^{3} \left (a + b \sin {\left (c \right )}\right )^{2}}{3} & \text {otherwise} \end {cases} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x**2*(a+b*sin(d*x**3+c))**2,x)

[Out]

Piecewise((a**2*x**3/3 - 2*a*b*cos(c + d*x**3)/(3*d) + b**2*x**3*sin(c + d*x**3)**2/6 + b**2*x**3*cos(c + d*x*
*3)**2/6 - b**2*sin(c + d*x**3)*cos(c + d*x**3)/(6*d), Ne(d, 0)), (x**3*(a + b*sin(c))**2/3, True))

________________________________________________________________________________________

Giac [A]
time = 4.20, size = 57, normalized size = 0.95 \begin {gather*} \frac {4 \, {\left (d x^{3} + c\right )} a^{2} + {\left (2 \, d x^{3} + 2 \, c - \sin \left (2 \, d x^{3} + 2 \, c\right )\right )} b^{2} - 8 \, a b \cos \left (d x^{3} + c\right )}{12 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^2*(a+b*sin(d*x^3+c))^2,x, algorithm="giac")

[Out]

1/12*(4*(d*x^3 + c)*a^2 + (2*d*x^3 + 2*c - sin(2*d*x^3 + 2*c))*b^2 - 8*a*b*cos(d*x^3 + c))/d

________________________________________________________________________________________

Mupad [B]
time = 4.72, size = 51, normalized size = 0.85 \begin {gather*} \frac {a^2\,x^3}{3}+\frac {b^2\,x^3}{6}-\frac {b^2\,\sin \left (2\,d\,x^3+2\,c\right )}{12\,d}-\frac {2\,a\,b\,\cos \left (d\,x^3+c\right )}{3\,d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x^2*(a + b*sin(c + d*x^3))^2,x)

[Out]

(a^2*x^3)/3 + (b^2*x^3)/6 - (b^2*sin(2*c + 2*d*x^3))/(12*d) - (2*a*b*cos(c + d*x^3))/(3*d)

________________________________________________________________________________________